<form id="coursePlanForm">
    <input name="id" type="hidden" th:value="${coursePlan?.id}">
    <!--<input id="courseId" name="courseId" type="hidden" th:value="${coursePlan?.courseId == null ? 0 : coursePlan?.courseId}">-->
    <div class="form-group row">
        <label for="d-pname" class="col-sm-2 col-form-label">课程名称:</label>
        <!--<div class="col-sm-10">
            <input type="text" onclick="showCoursePlan()" th:value="${coursePlan?.courseId==null?'无':coursePlan?.courseName}"
                   class="form-control" id="d-pname" placeholder="选择课程名称" readonly>
        </div>-->
        <div class="col-sm-10">
            <select name="courseId"  id="d-pname" th:with="type=${@dict.getCourseList()}" class="form-control m-b" required>
                <option th:each="dict : ${type}" th:text="${dict.key}" th:value="${dict.value}"
                        <!--th:field="*{coursePlan.courseId}"-->
                ></option>
            </select>

        </div>
    </div>




    <div class="form-group row">
        <label for="address" class="col-sm-2 col-form-label">上课期数</label>
        <div class="col-sm-10">
            <input type="text" th:value="${coursePlan?.periods}" name="periods" class="form-control"
                   id="periods"
                   placeholder="填写期数" required>
            <div class="invalid-feedback">请填写期数</div>
        </div>
    </div>
    
    <div class="form-group row">
        <label for="address" class="col-sm-2 col-form-label">上课地点</label>
        <div class="col-sm-10">
            <input type="text" th:value="${coursePlan?.address}" name="address" class="form-control"
                   id="address"
                   placeholder="填写上课地点" required>
            <div class="invalid-feedback">请填写上课地点</div>
        </div>
    </div>
    <div class="form-group row">
        <label for="startTime" class="col-sm-2 col-form-label">上课开始时间</label>
        <div class="col-sm-10">
            <input type="text"  name="startTime" class="form-control" id="startTime"
                   placeholder="填写上课开始时间" th:value="*{#dates.format(coursePlan?.startTime,'yyyy-MM-dd HH:mm:ss')}" required>
            <div class="invalid-feedback">请填写上课开始时间</div>
        </div>
    </div>

    <!--th:value="${coursePlan?.endTime}"-->
    <div class="form-group row">
        <label for="endTime" class="col-sm-2 col-form-label">上课结束时间</label>
        <div class="col-sm-10">
            <input type="text"  name="endTime" class="form-control" id="endTime"
                   placeholder="填写上课结束时间" th:value="*{#dates.format(coursePlan?.endTime,'yyyy-MM-dd HH:mm:ss')}" required >
            <div class="invalid-feedback">请填写上课结束时间</div>
        </div>
    </div>

    <div class="form-group row">
        <label for="d-pname" class="col-sm-2 col-form-label">是否启用:</label>
        <div class="col-sm-10">
            <select  name="status" id="d-pname1" th:with="type=${@dict.getStatusList()}" class="form-control m-b" required>
                <option th:each="dict : ${type}" th:text="${dict.key}" th:value="${dict.value}"
                ></option>
            </select>

        </div>
    </div>

    <div class="form-group col-xs-12" hidden>
        <label class="control-label">是否启用:</label>
        <div class="ml-3">
            <div class="icheck-primary icheck-inline">
                <input type="radio" id="top_on" name="status" value="1"   th:checked="@{(${coursePlan?.status == 1}? 'true' : 'false')}"/>
                <label for="top_on">启用</label>
            </div>
            <div class="icheck-primary icheck-inline">
                <input type="radio" id="top_off" name="status" value="2" th:checked="@{(${coursePlan?.status == 2}? 'true' : 'false')}"/>
                <label for="top_off">禁止</label>
            </div>
        </div>
    </div>

    <div class="form-group row" hidden>
        <label for="courseId" class="col-sm-2 col-form-label">课程ID</label>
        <div class="col-sm-10">
            <input type="text" th:value="${coursePlan?.courseId}" name="courseId" class="form-control"
                   id="courseId"
                   placeholder="课程ID" >
        </div>
    </div>

</form>

<script type="text/javascript">

    layui.use('laydate', function () {
        var laydate = layui.laydate;
        laydate.render({
            elem: "input[name='startTime']",
            type: 'datetime',
            trigger: 'click',
            format: 'yyyy-MM-dd HH:mm:ss'
        });

        laydate.render({
            elem: "input[name='endTime']",
            type: 'datetime',
            trigger: 'click',
            format: 'yyyy-MM-dd HH:mm:ss'
        });
    })


</script>